package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.pojo.BaseAttrValue;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.product.service.BaseAttrValueService;
import com.atguigu.gmall.product.mapper.BaseAttrValueMapper;
import org.springframework.stereotype.Service;

import javax.management.Query;
import java.util.List;

/**
* @author h8467
* @description 针对表【base_attr_value(属性值表)】的数据库操作Service实现
* @createDate 2022-11-29 16:02:29
*/
@Service
public class BaseAttrValueServiceImpl extends ServiceImpl<BaseAttrValueMapper, BaseAttrValue>
    implements BaseAttrValueService{

    @Override
    public List<BaseAttrValue> getListByAttrId(Long attrId) {
//        QueryWrapper<BaseAttrValue> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("attr_id",attrId);
//        List<BaseAttrValue> list = baseMapper.selectList(queryWrapper);
        LambdaQueryWrapper<BaseAttrValue> wrapper = new LambdaQueryWrapper<BaseAttrValue>().eq(BaseAttrValue::getAttrId, attrId);
        List<BaseAttrValue> list = baseMapper.selectList(wrapper);
        return list;
    }
}




